package com.zz.ecommerce.searchManage.waybillQdc;

import com.zz.ecommerce.common.GridRequest;
import com.zz.ecommerce.common.GridResult;
import com.zz.ecommerce.common.bean.qdc.db.TWaybillHeadQdc;
import com.zz.ecommerce.common.constants.TableConstants;
import com.zz.ecommerce.declareManage.common.dao.TWaybillHeadQdcDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by fanshilei on 2016/3/28.
 * <p/>
 * 查询跟踪服务--运单查询
 */
@Controller
@RequestMapping("/searchManage/waybillQdc")
@Scope("prototype")
public class SearchQdcTaxWaybillController {

    @Autowired
    private TWaybillHeadQdcDao tWaybillHeadQdcDao;

    /**
     * 运单管理初始页
     *
     * @return
     */
    @RequestMapping(value = "init", method = {RequestMethod.GET})
    public String init() {
        return "searchManage/waybillQdc/waybill";
    }

    /**
     * 运单列表页查询List
     *
     * @param tWaybillHeadQdc
     * @param request
     * @return
     */
    @RequestMapping("/queryTWaybillHeadQdcList")
    @ResponseBody
    public GridResult queryTWaybillHeadQdcList(TWaybillHeadQdc tWaybillHeadQdc, GridRequest request) {
        tWaybillHeadQdc.setIfCreate("0");
        return new GridResult(tWaybillHeadQdcDao.page(TableConstants.T_WAYBILL_HEAD_QDC, tWaybillHeadQdc, request.getStart(), request.getEnd(), request.getSortOrder()), request, tWaybillHeadQdcDao.count(TableConstants.T_WAYBILL_HEAD_QDC, tWaybillHeadQdc));
    }

}
